3.212 \(\int \frac {\tan ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=50 \[ \frac {a \log \left (a+b \tan ^2(e+f x)\right )}{2 b f (a-b)}+\frac {\log (\cos (e+f x))}{f (a-b)} \]

[Out]

ln(cos(f*x+e))/(a-b)/f+1/2*a*ln(a+b*tan(f*x+e)^2)/(a-b)/b/f

________________________________________________________________________________________

Rubi [A]  time = 0.09, antiderivative size = 50, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3670, 446, 72} \[ \frac {a \log \left (a+b \tan ^2(e+f x)\right )}{2 b f (a-b)}+\frac {\log (\cos (e+f x))}{f (a-b)} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

Log[Cos[e + f*x]]/((a - b)*f) + (a*Log[a + b*Tan[e + f*x]^2])/(2*(a - b)*b*f)

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tan ^3(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^3}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {x}{(1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \left (-\frac {1}{(a-b) (1+x)}+\frac {a}{(a-b) (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\log (\cos (e+f x))}{(a-b) f}+\frac {a \log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) b f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 41, normalized size = 0.82 \[ \frac {a \log \left (a+b \tan ^2(e+f x)\right )+2 b \log (\cos (e+f x))}{2 a b f-2 b^2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^3/(a + b*Tan[e + f*x]^2),x]

[Out]

(2*b*Log[Cos[e + f*x]] + a*Log[a + b*Tan[e + f*x]^2])/(2*a*b*f - 2*b^2*f)

________________________________________________________________________________________

fricas [A]  time = 0.45, size = 65, normalized size = 1.30 \[ \frac {a \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (a - b\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a b - b^{2}\right )} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/2*(a*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)) - (a - b)*log(1/(tan(f*x + e)^2 + 1)))/((a*b - b^2)*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check si
gn: (2*pi/x/2)>(-2*pi/x/2)2/f*(-1/4/b*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+
cos(f*x+exp(1)))-2))-1/(4*a-4*b)*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(1+cos(f
*x+exp(1)))+2))-a^2/(-4*a^2*b+4*a*b^2)*ln(abs(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1/(1-cos(f*x+exp(1)))*(
1+cos(f*x+exp(1))))*a-2*a+4*b)))

________________________________________________________________________________________

maple [A]  time = 0.14, size = 54, normalized size = 1.08 \[ \frac {a \ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 \left (a -b \right ) b f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a -b \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^3/(a+b*tan(f*x+e)^2),x)

[Out]

1/2*a*ln(a+b*tan(f*x+e)^2)/(a-b)/b/f-1/2/f/(a-b)*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 53, normalized size = 1.06 \[ \frac {\frac {a \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a b - b^{2}} - \frac {\log \left (\sin \left (f x + e\right )^{2} - 1\right )}{b}}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^3/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/2*(a*log(-(a - b)*sin(f*x + e)^2 + a)/(a*b - b^2) - log(sin(f*x + e)^2 - 1)/b)/f

________________________________________________________________________________________

mupad [B]  time = 11.78, size = 54, normalized size = 1.08 \[ \frac {a\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a\right )}{2\,f\,\left (a\,b-b^2\right )}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,f\,\left (a-b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^3/(a + b*tan(e + f*x)^2),x)

[Out]

(a*log(a + b*tan(e + f*x)^2))/(2*f*(a*b - b^2)) - log(tan(e + f*x)^2 + 1)/(2*f*(a - b))

________________________________________________________________________________________

sympy [A]  time = 3.67, size = 240, normalized size = 4.80 \[ \begin {cases} \tilde {\infty } x \tan {\relax (e )} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {- \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {\tan ^{2}{\left (e + f x \right )}}{2 f}}{a} & \text {for}\: b = 0 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac {1}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x \tan ^{3}{\relax (e )}}{a + b \tan ^{2}{\relax (e )}} & \text {for}\: f = 0 \\\frac {a \log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a b f - 2 b^{2} f} + \frac {a \log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a b f - 2 b^{2} f} - \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a b f - 2 b^{2} f} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**3/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((-log(tan(e + f*x)**2 + 1)/(2*f) + tan(e + f*x)**2/
(2*f))/a, Eq(b, 0)), (log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*b*f*tan(e + f*x)**2 + 2*b*f) + log(tan(e + f
*x)**2 + 1)/(2*b*f*tan(e + f*x)**2 + 2*b*f) + 1/(2*b*f*tan(e + f*x)**2 + 2*b*f), Eq(a, b)), (x*tan(e)**3/(a +
b*tan(e)**2), Eq(f, 0)), (a*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a*b*f - 2*b**2*f) + a*log(I*sqrt(a)*sq
rt(1/b) + tan(e + f*x))/(2*a*b*f - 2*b**2*f) - b*log(tan(e + f*x)**2 + 1)/(2*a*b*f - 2*b**2*f), True))

________________________________________________________________________________________